package com.sima.topics;

import javax.jms.*;

/**
 * Created by 锋情 on 2017-05-28.
 */
public class MyObjectListener implements MessageListener {
    public void onMessage(Message message) {
        try {
            UserModel u = (UserModel) ((ObjectMessage) message).getObject();
            System.out.println("通过MyListener收到的ObjectMessage消息："+ u.toString());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
